import request from '@/utils/request'

// 团队
const Aip = {
  // 团队成员
  memberList: '/boss/project/team/listTeam',
  memberDetail: '/boss/project/team/teamDetail',
  deleteMember: '/boss/project/team/deleteTeam',
  deleteLeader: '/boss/project/team/deleteAdmin',
  reinviteMember: '/boss/project/team/anewInviteTeam',
  // 研究中心 （注：研究中心里的团队成员和上面的团队成员是不同的接口）
  centerList: '/boss/project/manage/listResearch',
  addCenter: '/boss/project/team/research/add',
  deleteCenter: '/boss/project/team/research/delete',
  rolesList: '/boss/system/role/list',
  newRolesList: '/common/listRole',
  groupRolesList: '/boss/system/role/listRole',
  addCenterMember: '/boss/project/team/research/addMember',
  deleteCenterMember: '/boss/project/team/research/deleteMember',
  updateCenterMember: '/boss/project/team/research/updateMember',
  centerMemberList: '/boss/project/team/research/listMember',
  centerDetail: '/boss/project/team/research/detail',
  updateCenter: '/boss/project/team/research/update',
  updateMainRes: '/boss/project/team/updateMainRes',
  updateApprover: '/boss/project/team/updateIsCheck',
  reinviteCenterMember: '/boss/project/team/research/anewInviteRes',
  listCrc: '/boss/project/team/listCrc',
  contractCenter: '/boss/project/manage/listContractByRes',
  researchDetail: '/boss/project/team/research/detail/getById'
}

// 团队成员
// 团队成员列表
export function memberList (parameter) {
  return request({
    url: Aip.memberList,
    method: 'post',
    data: parameter
  })
}
// 团队成员详情
export function getMemberDetail (parameter) {
  return request({
    url: Aip.memberDetail,
    method: 'post',
    data: parameter
  })
}
// 删除团队成员
export function deleteMember (parameter) {
  return request({
    url: Aip.deleteMember,
    method: 'post',
    data: parameter
  })
}
// 删除项目负责人
export function deleteLeader (parameter) {
  return request({
    url: Aip.deleteLeader,
    method: 'post',
    data: parameter
  })
}
// 研究中心
// 中心列表
export function centerList (parameter) {
  return request({
    url: Aip.centerList,
    method: 'post',
    data: parameter
  })
}
// 添加研究中心
export function addCenter (parameter) {
  return request({
    url: Aip.addCenter,
    method: 'post',
    data: parameter
  })
}
// 删除研究中心
export function deleteCenter (parameter) {
  return request({
    url: Aip.deleteCenter,
    method: 'post',
    data: parameter
  })
}
// 获取角色列表
export function getRolesList (parameter) {
  return request({
    url: Aip.rolesList,
    method: 'post',
    data: parameter
  })
}
// 获取角色列表（新接口）
export function getNewRolesList (parameter) {
  return request({
    url: Aip.newRolesList,
    method: 'post',
    data: parameter
  })
}
// 获取团队成员新增项目负责人角色列表
export function getGroupRolesList (parameter) {
  return request({
    url: Aip.groupRolesList,
    method: 'post',
    data: parameter
  })
}
// 研究中心团队成员列表
export function centerMemberList (parameter) {
  return request({
    url: Aip.centerMemberList,
    method: 'post',
    data: parameter
  })
}
// 研究中心添加团队成员
export function addCenterMember (parameter) {
  return request({
    url: Aip.addCenterMember,
    method: 'post',
    data: parameter
  })
}
// 研究中心删除团队成员
export function deleteCenterMember (parameter) {
  return request({
    url: Aip.deleteCenterMember,
    method: 'post',
    data: parameter
  })
}
// 研究中心添加的团队成员更新
export function updateCenterMember (parameter) {
  return request({
    url: Aip.updateCenterMember,
    method: 'post',
    data: parameter
  })
}
// 研究中心添加的团队成员更新是否为项目负责人
export function updateMainRes (parameter) {
  return request({
    url: Aip.updateMainRes,
    method: 'post',
    data: parameter
  })
}
// 当前行研究中心详情
export function getCenterDetail (parameter) {
  return request({
    url: Aip.centerDetail,
    method: 'post',
    data: parameter
  })
}
// 更新研究中心
export function updateCenter (parameter) {
  return request({
    url: Aip.updateCenter,
    method: 'post',
    data: parameter
  })
}
// 更改审核人
export function updateApprover (parameter) {
  return request({
    url: Aip.updateApprover,
    method: 'post',
    data: parameter
  })
}
// 重新邀请团队成员
export function reinviteMember (parameter) {
  return request({
    url: Aip.reinviteMember,
    method: 'post',
    data: parameter
  })
}
// 重新邀请研究中心里的团队成员
export function reinviteCenterMember (parameter) {
  return request({
    url: Aip.reinviteCenterMember,
    method: 'post',
    data: parameter
  })
}

// 获取crc列表
export function getListCrc (parameter) {
  return request({
    url: Aip.listCrc,
    method: 'post',
    data: parameter
  })
}
// 获取发起项目合同所需的研究中心列表
export function getContractCenter (parameter) {
  return request({
    url: Aip.contractCenter,
    method: 'post',
    data: parameter
  })
}
export function getResearchDetail (parameter) {
  return request({
    url: Aip.researchDetail,
    method: 'post',
    data: parameter
  })
}
